<?php
require_once("../php/connection.php");

$res = mysql_query("SELECT * FROM site_groups WHERE `del`!='1' ORDER BY `id` DESC");
echo 'Recenlty groups<br>';

while($row = mysql_fetch_array($res))
{
	
	$gpid = $row['id'];
	$gpname = $row['name'];
	$res1 = mysql_query("SELECT * FROM site_group_members WHERE `gpid`='$gpid' AND `del`!='1'");
	
	$res2 = mysql_query("SELECT * FROM site_group_newness WHERE `gpid`='$gpid'");
	echo '<h3>'.$gpid.' - '.$gpname.' - '.mysql_num_rows($res1).' - '.date("Y-m-d H:i:s",mysql_result($res2, 0, 'newness')).'</h3>';
	while($row1 = mysql_fetch_array($res1))
	{
		//echo '<img src="http://facebook.com/'.$row1['fbid'].'/picture">';
		echo '* '.$row1['username'].'<br>'; 
	}
	
	echo '<hr>';
}

?>